#ifndef _IUPACKETARP_HPP_
#define _IUPACKETARP_HPP_

#include "iuPacket.hpp"
#include "iuMacAddress.hpp"
#include "iuIPAddress.hpp"

/**
 * @brief Differents types de paquets ARP
 */
enum iuPacketARPType
{
   ARP_REQUEST = 1,
   ARP_REPLY = 2
};

/**
 * @brief Classe representant un paquet ARP
 */
class iuPacketARP : public iuPacket
{
public:
   iuPacketARP();
   
   uint16_t getBufferLen() const;
   uint16_t fromBuffer(const char *buffer, uint16_t len);
   uint16_t toBuffer(char *buffer) const;

   void                setType(uint16_t type);
   uint16_t            getType() const;
   void                setSourceMac(const iuMacAddress &address);
   const iuMacAddress &getSourceMac() const;
   void                setDestinationMac(const iuMacAddress &address);
   const iuMacAddress &getDestinationMac() const;
   void                setSourceIp(const iuIPAddress &address);
   const iuIPAddress  &getSourceIp() const;
   void                setDestinationIp(const iuIPAddress &address);
   const iuIPAddress  &getDestinationIp() const;   
   
private:
   uint16_t m_type;
   iuMacAddress m_srcMac;
   iuMacAddress m_destMac;
   iuIPAddress m_srcIp;
   iuIPAddress m_destIp;
};

#endif
